<template>

<view class="media-list">
<navigator class="media-image-left" 
:url="'/pageb/shop/t?id='+newitem['id']" :open-type="opentype">
<view :class="['media-title',img?'media-title2':'']">
{{newitem['title']}}
<block v-if="img">
<view class="image-section">
<image style="width:140px;height:140px;" mode="aspectFill" lazy-load="true" 
:data-src="imgswt+img+anz" 
:src="imgswt+img+anz"></image></view>
</block></view>
<view class="media-foot">
<view class="huise"><text class="red">{{distance}}KM</text> - {{timestr}}</view></view>
</navigator></view>



</template>

<script>
export default {
	props: { newitem: {
            type: Object,
            default: {}
        },'lc': {
          
            default:false
        },'q': {
            type:String,
            default:''
        },'opentype': {
            type:String,
            default:'navigate'
        },
		},
	 computed: {
		 distance(){
		 			 if(this.lc==false) return 'NAN'
		 return getApp().globalData.ysv8set.GetDistance(this.lc,this.newitem.lc)
		 		 },
		 img(){
		return this.newitem.img.split("@")[0] 
	 },timestr(){
		 return getApp().globalData.ysv8set.timeStamp2String(this.newitem.btime);	 
	 }
	 },data() {
return {
anz:getApp().globalData.ysv8set.anz,
imgswt:getApp().globalData.ysv8set.imgswt,
}
				}
        
		
    }
</script>

<style>
.media-list{padding:20rpx;border-bottom:2rpx solid #d9d9d9;background-color:#fff}.media-title{-webkit-box-flex:1;-webkit-flex:1;flex:1;lines:3;text-overflow:ellipsis;color:#555}.media-title2{-webkit-box-flex:1;-webkit-flex:1;flex:1;margin-top:6rpx;line-height:1.8}.image-section{margin-top:20rpx;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}.media-info{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row}.media-foot{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;display:-webkit-box;display:-webkit-flex;display:flex}.huise{font-size: small;
    color: #919191;}
</style>
